from product_parse import TaobaoSpider
from queue import Queue
from product_link import TaobaoLink
from urllib.parse import quote

if __name__ == '__main__':
    q = Queue(maxsize=0)
    keyword = quote('男装')

    #生产消费模型
    link = TaobaoLink(q,keyword)
    link.start()
    threads = []
    for i in range(5):
        t = TaobaoSpider(q)
        t.start()
        threads.append(t)

    link.join()
    for t in threads:
        t.join()

